﻿@model IEnumerable<Fap.Workflow.Model.WfBusiness>

<title><fap-multilang lang-key="business_management" default-content="业务管理"></fap-multilang></title>

<div class="row">
    <div class="col-xs-12">
        @foreach (var bizGrp in Model.GroupBy(b => b.BizTypeUidMC))
        {
            <h4 class="smaller lighter green">@bizGrp.Key</h4>

            <ul class="list-inline bizprocess nav nav-pills">
                @foreach (var biz in bizGrp.AsEnumerable())
                {
                <li>
                    <a href="javascript:void(0)" data-business="@biz.Fid" data-bill="@biz.BillEntity">
                        <i class="ace-icon fa fa-suitcase green bigger-110"></i>
                        @biz.BizName
                    </a>
                </li>
                }
            </ul>
        }       
    </div>
</div>
<hr />
<div class="row">
    <div class="col-xs-12" id="myApplyContent">
        @*动态加载我的申请列表*@
    </div>
</div>
<script>
    var scripts = [null, "/lib/ueditor/ueditor.parse.js", "/Scripts/Workflow/workflow.js", "/Content/js/printThis.js", null]
    $('.page-content-area').ace_ajax('loadScripts', scripts, function () {
        jQuery(function ($) {
            $(document).one('ajaxloadstart.page', function (e) {
                //$(document).off(ace.click_event, '.dropdown-menu>li');
            })
            $(".bizprocess li>a").on(ace.click_event, function () {
                var $this = $(this);
                var businessUid = $this.data("business");
                //var billTable = $this.data("bill");
                $("#myApplyContent").empty();
                NProgress.start();
                $.get(basePath + "/Workflow/Business/Manage/" + businessUid, function (content) {
                    $("#myApplyContent").html(content);
                    //完毕重新设置jqgrid宽度
                    $(window).triggerHandler('resize.jqGrid');
                    NProgress.done();
                })
            })
        })
    });
</script>